package com.gxks.lhs.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 目的：映射图片路径
 * 为这个路径 设置一个网络访问地址path  /img
 */
@Configuration
//public class ImgResourceConfig extends WebMvcConfigurerAdapter {
public class ImgResourceConfig implements WebMvcConfigurer {
    /**
     * 配置静态访问资源
     *
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/img/**").addResourceLocations("file:D:/reggie-img/");
//        registry.addResourceHandler("/img/**").addResourceLocations("file:E:/imgs/secondHand/");
//        registry.addResourceHandler("/img/**").addResourceLocations("classpath:/static/images/imgs/");
    }
}
